<gm:page title="Google Docs Search" authenticate="false">  
    <h1>Find a Doc</h1>
  <gm:search id="mySearch" data="https://docs.google.com/feeds/documents/private/full" param="q" ref="atom:title" >
    
    
          <style type="text/css">
            @import url(http://www.google.com/uds/css/gsearch.css);

            #search_control__MODULE_ID__ {
              margin-top: 4px;
              margin-bottom: 2px;
              width : 100%;
              overflow : hidden;
            }

            #search_control__MODULE_ID__ {
              font-size : 13px;
            }

            #search_control__MODULE_ID__ table {
              font-size : 13px;
            }

            #search_control__MODULE_ID__ .gsc-configLabelCell {
              display : none;
            }

            #search_control__MODULE_ID__ .gs-webResult .gs-snippet {
              line-height : 1.3em;
              max-height : 2.6em;
              overflow : hidden;
            }

            #search_control__MODULE_ID__ .gsc-result {
              margin-bottom : 4px;
            }

            #search_control__MODULE_ID__ .gsc-control {
              width : 100%;
            }

            #search_control__MODULE_ID__ table.gsc-search-box {
              width : 100%;
            }

          </style>

          <script src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=internal-ig-ajaxsearch" type="text/javascript"></script>

          <script language="Javascript" type="text/javascript">

            function OnLoad__MODULE_ID__() {
              var searcherCount = 0;
              var prefs = new _IG_Prefs(__MODULE_ID__);

              var options = new GsearcherOptions();
              options.setExpandMode(GSearchControl.EXPAND_MODE_PARTIAL);

              // create a search control
              var searchControl = new GSearchControl();

              if ( prefs.getBool("localResults") ) {
                searcherCount++;
                var lat = null;
                var lng = null;
                var point = new Object();
                point.x = -122.084391;
                point.y = 37.421947;
                var local = new GlocalSearch();

                if ( prefs.getString("loc") ) {
                  lat = prefs.getString("loc.lat");
                  lng = prefs.getString("loc.long");
                  if ( lat != "0.0" && lng != "0.0" ) {
                    point = new Object();
                    point.x = lng;
                    point.y = lat;
                  }
                }
                local.setCenterPoint(point);

                if ( prefs.getBool("disableAddressLookup") ) {
                  local.setAddressLookupMode(GlocalSearch.ADDRESS_LOOKUP_DISABLED);
                } else {
                  local.setAddressLookupMode(GlocalSearch.ADDRESS_LOOKUP_ENABLED);
                }
                searchControl.addSearcher(local, options);
              }
              if ( prefs.getBool("webResults") ) {
                searcherCount++;
                searchControl.addSearcher(new GwebSearch(), options);
              }
              if ( prefs.getBool("videoResults") ) {
                searcherCount++;
                searchControl.addSearcher(new GvideoSearch(), options);
              }
              if ( prefs.getBool("blogResults") ) {
                searcherCount++;
                searchControl.addSearcher(new GblogSearch(), options);
              }

              var color = prefs.getString("color");
              if ( color != "default" ) {
                loadCssColor(color);
              }

              drawOptions = null;
              //if ( prefs.getBool("tabbedMode")  && searcherCount > 1) {
              //  drawOptions = new GdrawOptions();
              //  drawOptions.setDrawMode(GSearchControl.DRAW_MODE_TABBED);
              //}

              // tell the searcher to draw itself and tell it where to attach
              searchControl.draw(_gel("search_control__MODULE_ID__"), drawOptions);
              var initialSearchString = prefs.getString("initialSearch");
              if ( initialSearchString && initialSearchString != "" ) {
                searchControl.execute(initialSearchString);
              }
            }

            function loadCssColor(color) {
              var head = document.getElementsByTagName("head")[0];
              var css = document.createElement("link");
              var href = "http://www.google.com/uds/css/gsearch_" + color + ".css";
              css.href = href;
              css.rel = "stylesheet";
              css.type = "text/css";
              head.appendChild(css);
            }
            _IG_RegisterOnloadHandler(OnLoad__MODULE_ID__);
          </script>
          <div id="search_control__MODULE_ID__"><span style="color:#696969;">__MSG_loading__</span></div>
    
  </gm:search>
  <gm:list id="myList" data="${mySearch}"/>
</gm:page>


